<?php


namespace app\index\controller;


class Search extends Common
{
    public function index(){
        $keywords = input('keywords');
        $serRes = db('article')->order('id desc')->where('title','like','%'.$keywords.'%')->paginate(2,false,$config=[
            'query'=>array('keywords'=>$keywords)
        ]);
        $this->assign(
            [
                'serRes'=>$serRes,
                'keywords'=>$keywords
            ]
        );
        return view('search');
    }
}